VERSION 5.00
Begin VB.Form frmWatchCfg 
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   4335
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6465
   Icon            =   "frmWatchCfg.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4335
   ScaleWidth      =   6465
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdClr 
      Height          =   375
      Left            =   1800
      TabIndex        =   4
      Top             =   3840
      Width           =   735
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3600
      TabIndex        =   9
      Top             =   3840
      Width           =   1335
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "OK"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5040
      TabIndex        =   8
      Top             =   3840
      Width           =   1335
   End
   Begin VB.CheckBox chkAlert 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3240
      TabIndex        =   7
      Top             =   960
      Width           =   3015
   End
   Begin VB.CheckBox chkSoundOff 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3240
      TabIndex        =   6
      Top             =   600
      Width           =   3015
   End
   Begin VB.CheckBox chkSoundOn 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3240
      TabIndex        =   5
      Top             =   240
      Width           =   2895
   End
   Begin VB.CommandButton cmdDel 
      Caption         =   "Delete"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   960
      TabIndex        =   3
      Top             =   3840
      Width           =   735
   End
   Begin VB.CommandButton cmdAdd 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   2
      Top             =   3840
      Width           =   735
   End
   Begin VB.ListBox lstWatches 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3375
      Left            =   120
      Sorted          =   -1  'True
      TabIndex        =   1
      Top             =   360
      Width           =   2895
   End
   Begin VB.Label Label1 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   120
      UseMnemonic     =   0   'False
      Width           =   2415
   End
End
Attribute VB_Name = "frmWatchCfg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit



Private Sub cmdAdd_Click()
Dim nNick As String
Dim c As Integer

nNick = InputBox("Input nickname to add to watch list", "Add Watch")

If nNick = "" Then Exit Sub
' check for presence on list
For c = 0 To lstWatches.ListCount - 1
  If LCase(nNick) = LCase(lstWatches.List(c)) Then
    MsgBox "That person is already on your watch list.", vbOKOnly Or vbCritical, "Error"
    Exit Sub
  End If
Next

lstWatches.AddItem nNick
End Sub

Private Sub cmdCancel_Click()
Unload Me
End Sub

Private Sub cmdClr_Click()

If lstWatches.ListCount = 0 Then
MsgBox "Your list is already empty!", vbExclamation, "Error"
lstWatches.SetFocus
Exit Sub
End If

Dim msg As Byte
msg = MsgBox("This will clear your entire watch list. Do you wish to proceed?", vbYesNo + vbQuestion, "Question")
If msg = vbYes Then
lstWatches.Clear
lstWatches.SetFocus
Exit Sub
Else
lstWatches.SetFocus
End If

End Sub

Private Sub cmdDel_Click()
Dim msg As Byte
If lstWatches.ListIndex = -1 Then
MsgBox "Select a name before deleting!", vbOKOnly + vbCritical, "Error"
  Exit Sub
End If

msg = MsgBox("Do you really wish to remove " + GetWord(lstWatches.List(lstWatches.ListIndex), 1) + " from your watch list?", vbYesNo + vbQuestion, "Question")
If msg = vbYes Then
lstWatches.RemoveItem lstWatches.ListIndex
lstWatches.SetFocus
Exit Sub
Else
lstWatches.SetFocus
End If

End Sub

Private Sub cmdOk_Click()
Settings.WList = ""
Dim n As Integer

If lstWatches.ListCount > 0 Then
  For n = 0 To (lstWatches.ListCount - 1)
  Settings.WList = Settings.WList & lstWatches.List(n) & " "
  Next
  Settings.WList = Trim(Settings.WList)
End If
Settings.WSoundOn = CBool(chkSoundOn.Value)
Settings.WSoundOff = CBool(chkSoundOff.Value)
Settings.WAlert = CBool(chkAlert.Value)
' update wproc
frmMain.watchesProc = WordCount(Settings.WList)
'Resend the watch list to server
modAC.sendWatch

Unload Me

End Sub

Private Sub Form_Load()
Me.Caption = lang.Messages(51)
Label1.Caption = lang.Messages(52)
cmdAdd.Caption = lang.Buttons(14)
cmdDel.Caption = lang.Buttons(15)
cmdClr.Caption = lang.Messages(16)
chkSoundOn.Caption = lang.Messages(53)
chkSoundOff.Caption = lang.Messages(54)
chkAlert.Caption = lang.Messages(55)
cmdOK.Caption = lang.Messages(2)
cmdCancel.Caption = lang.Messages(3)

' populate the watchlist
Dim n As Integer

lstWatches.Clear
If WordCount(Settings.WList) > 0 Then
  For n = 1 To WordCount(Settings.WList)
    lstWatches.AddItem GetWord(Settings.WList, n)
  Next
End If

If Settings.WSoundOn = True Then chkSoundOn.Value = 1 Else chkSoundOn.Value = 0
If Settings.WSoundOff = True Then chkSoundOff.Value = 1 Else chkSoundOff.Value = 0
If Settings.WAlert = True Then chkAlert.Value = 1 Else chkAlert.Value = 0

End Sub

